package com.heima.wemedia;


import com.heima.aliyun.scan.GreenScan;
import com.heima.aliyun.scan.ScanResult;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;

import java.util.Arrays;

@SpringBootTest
public class SecurityDemo {

    @Autowired
    GreenScan greenScan;

    @Test
    public void testGreenScan() {
        try {
            ScanResult scanResult = greenScan.greenTextScan("不要贩卖冰毒,那是违法的");
            System.out.println(scanResult);
        } catch (Exception e) {
            e.printStackTrace();
        }

    }

    @Test
    public void imagesGreenScan() {
        try {
            ScanResult imageUrlScan = greenScan.imageUrlScan(Arrays.asList("https://project-item666.oss-cn-shanghai.aliyuncs.com/material/2022/7/20220704/943cdac3f7ca48d584d91f30d4cf3f55.jpg"));

            System.out.println(imageUrlScan);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

